<template>
  <el-form ref="form" :model="form" label-width="80px">
    <el-form-item label="报文关联名称" label-width="200px">
      <el-input v-model="form.name"></el-input>
    </el-form-item>
    <el-form-item label="系统报文模板" label-width="200px">
      <el-select v-model="form.tem1" placeholder="">
        <el-option v-for="item in options" :key="item.id" :label="item.name" :value="item.id"></el-option>
      </el-select>
    </el-form-item>
    <el-form-item label="客户报文模板" label-width="200px">
      <el-select v-model="form.tem2" placeholder="">
        <el-option v-for="item in options" :key="item.id" :label="item.name" :value="item.id"></el-option>
      </el-select>
    </el-form-item>
    <el-form-item label="关联描述" label-width="200px">
      <el-input type="textarea" v-model="form.desc"></el-input>
    </el-form-item>
    <el-form-item>
      <el-button type="primary" @click="onSubmit">保存</el-button>
    </el-form-item>
  </el-form>
</template>
<script>
export default {
  data() {
    return {
      form: {
        name: "",
        tem1:"",
        tem2:"",
        desc: ""
      }
    };
  },
  methods: {
    onSubmit() {
      let obj={...this.form,id:this.$GUID()}
      this.$setGL(obj)
      this.$router.push({ path: '/glTem', query: { GL: obj }})
    }
  },
  created(){
    this.options = this.$getMB();
  }
};
</script>